//
//  YQLTabBarController.m
//  YiQiLe_IOS
//
//  Created by 刘川 on 2018/5/23.
//  Copyright © 2018年 YiQiLe. All rights reserved.
//

#import "YQLTabBarController.h"
#import "UITabBarController+Add.h"
#import "SJZNavigationController.h"

@interface YQLTabBarController ()

@end

@implementation YQLTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self p_setup];
}

- (void)p_setup{
    
    self.tabBar.backgroundColor = [UIColor whiteColor];
    [[self p_getTabbarConfigureArray] enumerateObjectsUsingBlock:^(NSDictionary *  _Nonnull dict, NSUInteger idx, BOOL * _Nonnull stop) {
        [self addChildViewControllerName:dict[@"className"] title:dict[@"title"] titleColor:kHexColor(@"#999999") selectedColor:kRGBA(245, 77, 83, 1) image:dict[@"image_normal"] selectedImage:dict[@"image_select"] imageInsets:UIEdgeInsetsZero titlePosition:UIOffsetMake(0, -2) navControllerName:@"SJZNavigationController"];
    }];
}

- (NSArray *)p_getTabbarConfigureArray{
    NSArray *configureArray = @[
                                @{
                                    @"className": @"SJZHomePageViewController",
                                    @"title": @"首页",
                                    @"image_normal": @"sjz_tabBar_home_n",
                                    @"image_select": @"sjz_tabBar_home_h"
                                    },
                                @{
                                    @"className": @"SJZStatisticalViewController",
                                    @"title": @"统计",
                                    @"image_normal": @"sjz_tabBar_tongji_n",
                                    @"image_select": @"sjz_tabBar_tongji_h"
                                    },
                                @{
                                    @"className": @"SJZMineViewController",
                                    @"title": @"我的",
                                    @"image_normal": @"sjz_tabBar_mine_n",
                                    @"image_select": @"sjz_tabBar_mine_h"
                                    
                                    },
                                ];
    return configureArray;
}

@end
